package net.fonline.apps;

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import net.fonline.apps.pathfinder.*;

/**
 * This is the main MIDlet. Does nothing more but starting the game and running the main-loop.
 * @author Michael
 */
public class LineTowerWars extends MIDlet {

    public static EchoCanvas ec;
    private boolean run = false;

    public void startApp() {
        run = true;
        Display display = Display.getDisplay(this);
        ec = new EchoCanvas(display);
        display.setCurrent(ec);
        while (run) {
            ec.map.move(16.0D);
            ec.cheatbot.move(16.0D);
            ec.missiles.move(16.0D);
            ec.repaint();
            try {
                Thread.sleep(16);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            }
        }
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
        run = false;
    }
}